﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.ScheduleJob.SPI;

namespace T.FAS.Runtime.ScheduleJob.Engine
{
    class ScheduleJobImpEngineFactory
    {
        public static IScheduleJobImpEngineProxy Create(ScheduleJobExecContext context)
        {
            IScheduleJobImpEngineProxy engine = null;
            switch (context.ScheduleJobMetaData.JobType)
            {
                case Metadata.Entity.ScheduleJob.JobType.JSSCript:
                    engine = new ServerJSJobEngine();
                    break;
                case Metadata.Entity.ScheduleJob.JobType.Action:
                    engine = new ActionJobEngine();
                    break;
                case Metadata.Entity.ScheduleJob.JobType.Subscription:
                    engine = new SubscriptionJobEngine();
                    break;
                default:
                    engine = new UserDefineJobEngine();
                    break;
            }
            return engine;

        }
    }
}
